﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Workflow.Alerts.Interfaces.ProfileSettings;
using Sitecore.Data.Items;

namespace Workflow.Alerts.Sublayouts.ProfileSettings
{
    public partial class StartFee : BaseControl, IStartFeeView
    {
        #region IStartFeeView Members

        public float Fee
        {
            get
            {
                return float.Parse(txtPrice.Text);
            }
            set
            {
                txtPrice.Text = value.ToString();
            }
        }

        public event OnStartFeeViewLoad OnPageLoad;
        public event OnStartFeeViewUpdate OnUpdate;


        #endregion

        #region Events

        protected void Page_Load(object sender, EventArgs e)
        {
            PresentationManager.RegisterView(typeof(StartFeePresenter), this, new WebSessionProvider());

            if (!IsPostBack && OnPageLoad != null)
            {
                OnPageLoad();
            }
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (OnUpdate != null)
            {
                OnUpdate();
                lblUpdateSuccess.Visible = true;
            }

        }

        #endregion
    }
}